# Contributor: Iskren Chernev <iskren.chernev@gmail.com>
# Maintainer: Iskren Chernev <iskren.chernev@gmail.com>
pkgname=py3-dt-schema
pkgver=2021.12
pkgrel=0
pkgdesc="Devicetree schema tools"
url="https://github.com/devicetree-org/dt-schema"
arch="noarch"
license="BSD-2-Clause"
depends="python3 py3-ruamel.yaml py3-jsonschema py3-rfc3987"
makedepends="py3-setuptools py3-setuptools_scm"
source="dt-schema-$pkgver.tar.gz::https://github.com/devicetree-org/dt-schema/archive/v$pkgver.tar.gz"
builddir="$srcdir/dt-schema-$pkgver"

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" python3 setup.py build
}

package() {
	SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" python3 setup.py install --prefix=/usr --root="$pkgdir"
}

check() {
	PYTHONPATH=. python3 test/test-dt-validate.py
}

sha512sums="
1eb6997a660aefefe07fe40f6966adbcb92853c71504e02fef63cfc5eee4fb6abb1257bf4d1fc798b4874da94bc029997abcf7bc338aedc881b152449b88646c  dt-schema-2021.12.tar.gz
"
